<?php

class Eleven_Form_Introduction_Edit extends Zend_Form
{
	public function init()
	{
	    $this->setDisableLoadDefaultDecorators(true);
        $this->setDecorators(array(
            array(
                'ViewScript',
                array('viewScript'=>'aintroduction/_edit.phtml')
            ),
            'Form'
        ));
        
        $this->setAttrib('enctype', 'multipart/form-data');
        
        $file1 = new Zend_Form_Element_File('pic1');
        $file1->setDestination('./data/uploads/tmp/')
            ->addValidator('Count', false, 1)
            ->addValidator('Size', false, 20240000)
            ->addValidator('Extension', false, 'jpg,png,gif')
            ->setAttrib('size', 65);
        $file1->removeDecorator('Label');
        $file1->removeDecorator('HtmlTag');
        $this->addElement($file1);
        
		$this->addElement('text', 'title', array(
			'required'		=> true,
			'label'			=> '标题：',
		));
		
		$this->getElement('title')->setDecorators(array(
            'ViewHelper',
		    'Errors',
        ));
        
        $this->getElement('title')->setAttrib('class', 'announcement_title');
        		
		$this->addElement('textarea', 'content', array(
			'required'		=> true,
			'label'			=> '内容：',
		    'cols'			=> '60',
		    'rows'			=> '15',
		));
		
		$this->getElement('content')->setDecorators(array(
            'ViewHelper',
		    'Errors',
        ));
		
		$this->addElement('submit', 'submit', array(
			'ignore'		=> true,
		));
		
		$this->getElement('submit')->setLabel('')
		    ->setAttrib('class','announcement_submit');;
	}

}

?>